﻿using NPOI.SS.Formula.Functions;
using Org.BouncyCastle.Crypto.Generators;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyCore.UnifyResult
{
    public class RESTfulApiResult
    {
        /// <summary>
        /// 状态码
        /// </summary>
        public int StatusCode { get; set; }

        /// <summary>
        /// 消息
        /// </summary>
        public string Msg { get; set; }

        /// <summary>
        /// 数据
        /// </summary>
        public object Data { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        public object Errors { get; set; }

        /// <summary>
        /// 时间戳
        /// </summary>
        public long Timestamp { get; set; }

        public RESTfulApiResult(int statusCode, object data = default,object errors = default) {
            StatusCode = statusCode;
            Data = data;
            Errors = errors;
            Timestamp = DateTime.Now.ToFileTimeUtc(); //时间截
        }


        public RESTfulApiResult(int statusCode, string msg = default, object data = default, object errors = default)
        {
            StatusCode = statusCode;
            Msg = msg;
            Data = data;
            Errors = errors;
            Timestamp = DateTime.Now.ToFileTimeUtc(); //时间截
        }
    }
}
